{ 
Function:    _JMATrueRange 

Purpose:     ATR using Jurik Moving Average.
     
Author:      MarkSanDiego
 
Date:        05/06/07   original version
             09/06/08   TrueRange function converted to inline code
             01/04/09   inline code produces unexpected outputs during first Length*2 bars
                        Build in TrueRange function restored to code
             01/23/11   posted to forum
             12/07/12	faster true range calculation implemented              
}

Inputs: 
    Length(NumericSimple);      { Length must not change }

vars:
    Len(MaxList(1, Length)),    { JAM can not accept a Length = 0 }   
    double tRange(0);		

	
	tRange = MaxList(Close[1], High) - MinList(Close[1], Low);
	
	_JMATrueRange = JRC.JMA.2k(tRange, Len, 0);